/**
 * 
 */
package uk.ac.ebi.velvet.util.io;


/**
 * @author mhaimel
 *
 */
public class SequenceUtil {
	

	public static String clearDNA(String s){
		StringBuffer b = new StringBuffer();
		for(char c : s.toCharArray()){
			if(isDNA(c)){
				b.append(c);
			}
		}
		return b.toString();
	}

	private static final char LOW_START = 'a';
	private static final char LOW_END = 'z';

	private static final char UPPER_START = 'A';
	private static final char UPPER_END = 'Z';
	
	public static boolean isDNA(char c){
		return (c >= LOW_START && c <= LOW_END)
				|| (c >= UPPER_START && c <= UPPER_END);
	}
	
}
